package top.lingkang.finalvalidated.error;

import top.lingkang.finalvalidated.handle.ValidVal;

/**
 * @author lingkang
 * Created by 2024/1/26
 * 框架校验异常
 */
public class ValidatedException extends RuntimeException {
    private ValidVal validVal;
    private String message;

    public ValidatedException(String message, ValidVal validVal) {
        this.validVal=validVal;
        this.message = message;
    }

    public ValidatedException(String message) {
        this.message = message;
    }

    public ValidVal getValidVal() {
        return validVal;
    }

    public ValidatedException setValidVal(ValidVal validVal) {
        this.validVal = validVal;
        return this;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
